<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
<head>
<title>登录页面</title>
<script src="${ctxStatic}/jqGrid5/js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctxStatic}/CryptoJS/components/core-min.js" charset="utf-8" ></script>
<script type="text/javascript" src="${ctxStatic}/CryptoJS/rollups/sha256.js" charset="utf-8" ></script>
<script type="text/javascript">
function saveUsername(theForm) {
	var action = "${ctx}/loginCheck"
	var u = $("#j_username").val();
	var p = $("#j_password").val();
	p = CryptoJS.SHA256(p+"{"+u+"}");
	theForm.action = action + "?username=" + u + "&encryptionStr=" + p;
}
function flashCaptcha() {
	$("#captchaImg").attr("src","${ctx}/security/jcaptcha.jpg?d=" + new Date().getTime());
}
</script>
</head>
<body>
<form method="post" id="loginForm" name="loginForm"
				onsubmit="saveUsername(this);">
				<div class="close" title="关闭"></div>
				<p class="title">用户登录</p>
				<ul>
<!-- 				    <li class="prompt" style="font-size:13px"> -->
<%-- 					    <c:if test="${!empty param.error}"> --%>
<%-- 											<c:if test="${param.error == '1'}"> --%>
<!-- 											<font color="red" style="font-size: 12px" > -->
<%-- 												<c:choose> --%>
<%-- 													<c:when test="${failureCount==0}"> --%>
<!-- 													    密码错误次数过多，账号现已被锁定，请联系管理员 -->
<%-- 													</c:when> --%>
<%-- 													<c:when test="${not empty failureCount}"> --%>
<%-- 													    用户名或密码错误,再连续输错${failureCount}次，账号将被锁定 --%>
<%-- 													</c:when> --%>
<%-- 													<c:otherwise> --%>
<!-- 													    用户名或密码错误，请重新尝试 -->
<%-- 													</c:otherwise> --%>
<%-- 												</c:choose> --%>
<!-- 											</font> -->
<%-- 											</c:if> --%>
<%-- 											<c:if test="${param.error == '2'}"> --%>
<!-- 											<font color="red" style="font-size: 12px" >长时间未使用，请重新登录！</font> -->
<%-- 											</c:if> --%>
<%-- 											<c:if test="${param.error == '3'}"> --%>
<!-- 											<font color="red" style="font-size: 12px" >账号在其他地方登录！</font> -->
<%-- 											</c:if> --%>
<%-- 											<c:if test="${param.error == '4'}"> --%>
<!-- 											<font color="red" style="font-size: 12px" >验证码错误！</font> -->
<%-- 											</c:if> --%>
<%-- 						</c:if>&nbsp; --%>
<!-- 				    </li> -->
					<li><div class="img">用户名</div><div class="rg"></div><input type="text" id="j_username" class="user bg" placeholder="请输入用户名"  /></li>
					<li><div class="img">密&nbsp;&nbsp;&nbsp;&nbsp;码</div><div class="rg"></div><input type="password" id="j_password" class="password bg" placeholder="请输入密码" 	autocomplete="off" /></li>
					<li><div class="img">验证码</div>
						<input type="text" class="validate bg" name="j_captcha" placeholder="验证码" />
						<img src="${ctx}/security/jcaptcha.jpg" id="captchaImg" alt="点击更新验证码" title="点击更新验证码" onclick="flashCaptcha()"/>
						<div style="clear:both;"></div>
					</li>
					<li style="margin:0px;"><input type="submit" class="loginbtn" value="登录" /></li>
				</ul>
			</form>
			${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message} 
</body>
</html>